<template>
    <div class="float-ball" v-bind:class="{'hide':!show}">
        <div class="service-list">
            <a class="item" v-bind:href="'tel:' + phone ">
                <div class="phone"></div>
            </a>
            <div class="item kefu"  v-on:click="kefu_call()" >
                <div class="kefu"></div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "float-ball",

        data:function(){
            return {
                show:0,
                phone:''
            }
        },

        methods:{

            init:function(){

                var t = this;
                var url = this.config.app_url + '&r=home.setting';
                this.axios.get( url ).then(function (res) {

                    t.show = res.data.settings.float_nav_show;
                    t.phone = res.data.settings.phone;


                });


            },

            kefu_call:function(){

                // todo 创建会话
                var t = this;
                var url = this.config.app_url + '&r=home.kefu_open';
                this.axios.post( url ).then(function (res) {

                });

            }

        },

        created:function(){

            this.init();
        }
    }
</script>

<style scoped>

</style>